import Koa from "koa";
import Router from "@koa/router";
const router = new Router();

// 初始化 Koa 应用实例
const app = new Koa();

// 响应用户请求

router.get("/", async (ctx, next) => {
  ctx.body = "你好，我这里是index页";
});

router.get("/user", async (ctx, next) => {
  ctx.body = "你好，我这里是user页";
});

router.get("/error", async (ctx, next) => {
  ctx.body = "你好，我这里是error页";
});



app.use(router.routes());

// 运行服务器
app.listen(3000);
console.log("启动成功");
